﻿// <copyright file="ModlrPlugin.cs" company="Codeplex project Eco.Contrib"> 
// The MIT License (MIT) 
// </copyright> 
// <author>Peter Buchmann</author> 

namespace Eco.Contrib
{
    using System.Collections.Generic;
    using Eco.Services;
    using global::Modlr.Plugins;

    /// <summary>
    /// Modlr plugin
    /// </summary>
    public class ModlrPlugin : IModlrPlugin, IModlrPluginModelAccessOclType
    {
        /// <summary>
        /// Gets the name.
        /// </summary>
        /// <returns>Name of the plugin</returns>
        public string GetName()
        {
            return "Eco.Contrib";
        }

        /// <summary>
        /// Provides the operations.
        /// </summary>
        /// <returns>List of provided operations</returns>
        [System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Design", "CA1002:DoNotExposeGenericLists", Justification = "Must be exposed to hit interface definition")]
        [System.CLSCompliant(false)]
        public List<IModlrPluginMenuOperation> ProvideOperations()
        {
            return new List<IModlrPluginMenuOperation>();
        }

        /// <summary>
        /// Runtimes the model access.
        /// </summary>
        /// <param name="ocl">The ocl.</param>
        public void RuntimeModelAccess(IOclTypeService ocl)
        {
            if (ocl == null)
            {
                throw new EcoContribException("Parameter is null");
            }

            ocl.InstallOperation(new OclSplit());
            ocl.InstallOperation(new OclEnsureObjects());
            ocl.InstallOperation(new OclEnsureRelated());
        }
    }
}